Ive already given an answer to this, but was for urgent problems, as it worked only if the ellipse was drawn in a unique colour (different from any in the background).
The following example shows how to achieve the effect and can be extended to any kind of shapes (not just ellipse, but it's easier with regular shapes).
You'll find a procedure inside the example, called OUTELLIPSE that isn't called. It's sufficient to copy that and it'll work. In the example I follow a different way, just to reduce the waste of memory, but the procedure is easier n more safe.
>
> 'Outside-Clear by Andy Naimoli
> 'Example for clearing anything outside an ellipse
>
> Flash Off : Curs Off
>
> FLAG=False : Rem switch to true for fast-mode
> SW=320 : SH=200
> CX=160 : CY=100 : R1=80 : R2=40
>
> For N=1 To 100
> Ink Rnd(31) : Draw To Rnd(SW),Rnd(SH)
> Next N
>
> PAUSA["Now draw ellipse.",FLAG]
> Ellipse CX,CY,R1,R2
>
> PAUSA["Done! Make a copy.",FLAG]
> If FLAG Then Auto View Off
> Screen Open 1,R1*2,R2*2,32,Lowres : Flash Off
> If FLAG Then Screen Hide 1
> Screen Copy 0,CX-R1,CY-R2,CX+R1,CY+R2 To 1,0,0
>
> PAUSA["Delete inside.",FLAG]
> Ink 0
> For R=Min(R1,R2) To 1 Step -1 : Bell 90-R
> If R1<R2 Then Ellipse R1,R2,R,R2 Else Ellipse R1,R2,R1,R
> Next R
> If R1<R2 Then Draw R1,0 To R1,Screen Height Else Draw 0,R2 To Screen Width,R2
>
> PAUSA["Xor with original",FLAG]
> Screen Copy 1,0,0,Screen Width,Screen Height To 0,CX-R1,CY-R2,96
> Screen Close 1
> If FLAG Then Auto View On
>
> PAUSA["Clear all around",FLAG]
> Cls ,0,0 To SW,CY-R2
> Cls ,0,CY+R2 To SW,SH
> Cls ,0,CY-R2 To CX-R1,CY+R2
> Cls ,CX+R1,CY-R2 To SW,CY+R2
>
> Procedure PAUSA[T$,F]
> If F Then Pop Proc
> S=Screen : Screen 0 : Locate ,24 : Cline : Centre T$ : Screen S
> Bell : Wait Key
> End Proc
>
> Procedure OUTELLIPSE[CX,CY,R1,R2]
> Rem This example uses Screen 0 as source and Screen 1 as target
> Rem considering that source is the default screen
>
> Rem Open a screen like the source one
> Auto View Off
> Screen Open 1,320,200,32,Lowres
> Screen Hide 1
>
> Rem Copy source to target and draw a filled ellipse (Ink 0)
> Screen Copy 0 To 1
> Screen 1 : Ink 0 : Ellipse CX,CY,R1,R2
> For R=Min(R1,R2) To 1 Step -1
> If R1<R2 Then Ellipse CX,CY,R,R2 Else Ellipse CX,CY,R1,R
> Next R
> If R1<R2 Then Draw R1,0 To R1,Screen Height Else Draw 0,R2 To Screen Width,R2
>
> Rem Transfer target on source XORing to preserve graphic inside ellipse!
> Screen Copy 1 To 0,,,96 : Screen Close 1
>
> End Proc
>
The idea is simple (but not so easy to be thought): just create a copy of the screen n then fill IN the shape created. Then transfer this on the original background XORing it all, so only the area inside the shape is preserved!!!!!
Andy - naimoli@cli.di.unipi.it
* *** * * *
** * * ** * May the power be with us!!!!!!!!!!!!!!